import React, { Component } from 'react'
import { Table, Tag, Space ,Modal,CreatePlanModal} from 'antd';
import './index.css'
import ModalForm from './ModalForm';



const data = [
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    address: 'New York No. 1 Lake Park',
  },
  {
    key: '2',
    name: 'Jim Green',
    age: 42,
    address: 'London No. 1 Lake Park',
  },
  {
    key: '3',
    name: 'Joe Black',
    age: 32,
    address: 'Sidney No. 1 Lake Park',
  },
];

export default class Driver extends Component {

  onView = (record) => {
   
  }


  render() {
    const columns = [
      {
        title: 'Name',
        dataIndex: 'name',
        key: 'name',
        render: text => <a>{text}</a>,
      },
      {
        title: 'Age',
        dataIndex: 'age',
        key: 'age',
      },
      {
        title: 'Address',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: 'Action',
        key: 'action',
        render: (text, record) => (
          <Space size="middle">
            {/* <a onClick={this.onView(record)}>查看</a> */}
            {/* <a onClick={this.onEdit(record)}>编辑</a>
            <a onClick={this.onRemove(record)}>删除</a> */}
          </Space>
        ),
      },
    ];

  //   const onView = (record) => {
  //     return () => {
  //         this.props.dispatch({
  //             type: 'showModalForm',
  //             data: {
  //                 title: '详情',
  //                 // data: { ...record, attrs: JSON.parse(record.attrs) },

  //             }
  //         })
  //     }
  // }

    return (
      <div><Table id='roleTable'
        pagination={{
          position: ['bottomCenter'],
          showSizeChanger: true,
          showQuickJumper: true,
          showTotal: (total) => {
            return (
              <span
                style={{
                  fontSize: 16,
                  color: '#264653',
                  fontFamily: "微软雅黑",
                }}
              >共{total}条数据</span>
            )
          }
        }}
        columns={columns} dataSource={data} 
    
/>
        </div>
    )
  }
}
